home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13054 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: howland.reston.ans.net!psinntp!psinntp!psinntp!psinntp!usenet
  2. From: grantp@usa.pipeline.com(Pete Grant)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Can't compile template class with g++
  5. Date: 23 Mar 1996 03:43:43 GMT
  6. Organization: Pipeline USA
  7. Message-ID: <4ivs1f$30h@news1.h1.usa.pipeline.com>
  8. References: <31534476.1A120953@henson.cc.wwu.edu>
  9. NNTP-Posting-Host: 38.8.61.11
  10. X-PipeUser: grantp
  11. X-PipeHub: usa.pipeline.com
  12. X-PipeGCOS: (Pete Grant)
  13. X-Newsreader: Pipeline v3.5.0
  14.  
  15. On Mar 22, 1996 16:23:18 in article <Can't compile template class with
  16. g++>, 'Kiet Lam <n9448673@henson.cc.wwu.edu>' wrote: 
  17.  
  18.  
  19. >I am having problem compiling the following codes under Linux 1.2.8 
  20. >with g++ compiler. 
  21. >template <class ET> class CTemplate { 
  22. >public: 
  23. >CTemplate(ET Init); 
  24. >void Show(void); 
  25. >protected: 
  26. >private: 
  27. >ET InitValue; 
  28. >}; 
  29. template<class ET> ////// You needs this... 
  30. >CTemplate<ET>::CTemplate(ET Init) { //compiler complains at this line 
  31. and this ... ^^^^^ 
  32. >InitValue = Init; 
  33. >} 
  34.  
  35. >void CTemplate::Show(void) { //compiler complains at this line too 
  36. >cout << "InitValue = " << InitValue << endl; 
  37. >} 
  38. See above.  Needs same fixes. 
  39.  
  40. -- 
  41.  
  42. Pete Grant 
  43. Kalevi, Inc. 
  44. Sofware Engineering
  45.